﻿require.config({
	baseUrl: "scripts",
	paths: {
		underscore: "underscore-min",
		jquery: "jquery-1.10.2.min", 
		"bootstrap": "bootstrap.min",
		angular: "angular.min",
		"angular-sanitize": "angular-sanitize.min",
		"angular-ui-router": 'angular-ui-router.min',
		routerModule: "routers/module",
		angularCommon: "common.angular",
		controllerModule: "controllers/module",
		directiveModule: "directives/module",
		serviceModule: "services/module",
		'domReady': 'domReady.min'
	},
	shim: {
		"underscore": {
			exports: "_"
		},
		"bootstrap": {
			depts: ["jquery"],
			exports : 'bootstrap' 
		},
		"angular": {
			exports: "angular"
		},
		"angular-sanitize": {
			depts: ["angular"],
			exports: "ngSanitize"
		},
		"angular-ui-router": {
			depts: ["angular"],
			exports: "angular-ui-router"
		},
		"angularCommon": {
			depts: ["angular"],
			exports: "common"
		}
	}
});


require(["jquery", "angular", 
		(require_router==null?"app.require":("routers/" + require_key + "Router"))
	], function($, angular){
		console.log($().jquery);
		require(['domReady!'],function(document){
			angular.bootstrap(document, ["webapp"])
		});
	}
);